package com.xuantu.pattern.create.singleton;

import java.util.concurrent.atomic.AtomicLong;

/**
 * 枚举模式
 * 线程安全
 * @author fengzp
 *
 */
public enum EnumSingleton {
	
	INSTANCE;

	private AtomicLong nextUniqueNumber = new AtomicLong();

	public Long getNextNumber() {
		// return nextNumber++;
		return nextUniqueNumber.incrementAndGet();
	}
	 
}
